#Requires AutoHotkey v2.0
#Include CSV_Pcr.ahk

;;;;;;;;;;;;;;;;;;;;
a := CSV_Pcr()
f := FileTool()

te := f.read("testdata2.csv")
a.Load(te)

;msgBox(a.text)

MsgBox("表格行数:" . a.content.Length) 

;MsgBox(a.getCell(6,15))

;MsgBox("(1,1)" . a.getCell(1,1))
;MsgBox("(1,2)" . a.getCell(1,2))
;MsgBox("(1,3)" . a.getCell(1,3))

;MsgBox("(2,1)" . a.getCell(2,1))
;MsgBox("(2,2)" . a.getCell(2,2))

; MsgBox(a.getCell(13,2))
; MsgBox(a.getCell(5,1))

; 测试插入一行数据

row1 := Array("安妮","法师")
row2 := ["加尔鲁什","战士"]
row3 := ["克苏恩","上古之神"]
row4 := ["------","------"]

a.addRow(row4, "before")
a.addRow(row1, 2)
a.addRow(row2, "after")
a.addRow(row3, 3)

MsgBox("表格行数:" . a.content.Length) 

MsgBox(Format("查询单元格[{},{}]:{}", 15, 2, a.getCell(15,2)))
ss := a.toCSV()
MsgBox(ss)